package com.Smart.smartscals.Adapter;

import java.util.ArrayList;
import java.util.HashMap;

import com.Smart.smartscals.Activity.R;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
import android.widget.TextView;





/**
 * 
 * @author huangbin Adapter;
 * 
 
 
 */
public class GalleryAdapter extends BaseAdapter {

	private ArrayList<String> arrayList;
	private Context mContext;
	private int mGalleryItemBackground;

	public GalleryAdapter(ArrayList<String> arrayList, Context mContext) {
		super();
		this.arrayList = arrayList;
		this.mContext = mContext;

		// TypedArray a = mContext.obtainStyledAttributes(R.styleable.Gallery1);
		// mGalleryItemBackground = a.getResourceId(
		// R.styleable.Gallery1_android_galleryItemBackground, 0);
	}

	public int getCount() {
		return arrayList.size();
	}

	public Object getItem(int position) {
		return arrayList.get(position);
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {

		if (convertView == null) {
			TextView tv = new TextView(mContext);
			
			tv.setTextSize(50);
			tv.setTextColor(Color.BLUE);
			tv.setLayoutParams(new Gallery.LayoutParams(300, 300));
			convertView = tv;
		}
		((TextView) convertView).setText(arrayList.get(position));
		return convertView;

	}
}
